/*
 * ADC.h
 *
 * Created: 1/17/2013 7:03:20 PM
 *  Author: Hp-Minion
 */ 


#ifndef ADC_H_
#define ADC_H_
/*****************************************************************************************/
/*
	INCLUDES
*/	
		#include "General.h"

/*****************************************************************************************/
/*
	DEFINES
*/	
			#define AREF_VALUE 5
			#define MAX_DECIMAL_RESOLUTION 1024
			#define MAX_ADC_READINGS 100
			// temperature defines
			#define KELVIN_OVER_CELSIUS_OFFSET 273
			// humidity defines
			#define SOIL_HUM_STEP_DRY 200
			#define SOIL_HUM_STEP_NORMAL 450
			#define SOIL_HUM_STEP_WET 700

/*****************************************************************************************/
/*
	VARIABLES
*/	
            typedef enum {
				SOIL_HUM_TYPE_AIR,
				SOIL_HUM_TYPE_DRY,
				SOIL_HUM_TYPE_NORMAL,
				SOIL_HUM_TYPE_WET,
				SOIL_HUM_TYPE_WATER,
				
				SOIL_HUM_TYPE_COUNT
				
			} SoilHumidityType;


/*****************************************************************************************/
/*
	FUNCTION PROTOTYPES
*/	
		extern void ADC_Init(unsigned char );
		extern StatusCodes ADC_Temp_Handler( unsigned char intPin, AreaConditions *garden );
		extern StatusCodes ADC_Hum_Handler( unsigned char intPin, AreaConditions *garden );
        extern StatusCodes ADC_Light_Handler( unsigned char intPin, unsigned char *gardenLight );

/*****************************************************************************************/
#endif /* ADC_H_ */